package com.jxdinfo.hussar.cloud.module.example.dljc.basketdata.controller;

import com.jxdinfo.hussar.cloud.module.example.dljc.basketdata.model.BasketData;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdata.service.BasketDataService;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdata.vo.BasketDataPageVO;
import com.jxdinfo.hussar.cloud.module.example.dljc.basketdata.vo.BasketDataSearchVO;
import com.jxdinfo.hussar.platform.core.base.apiresult.ApiResponse;
import com.jxdinfo.hussar.support.audit.core.annotations.AuditLog;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventGrade;
import com.jxdinfo.hussar.support.audit.core.enums.AuditEventType;
import com.jxdinfo.hussar.support.mp.base.controller.HussarBaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 吊篮监测实时数据控制器
 */
@RestController(value = "dljc.basketdata.BasketDataController")
@AuditLog(moduleName = "吊篮监测实时数据")
@RequestMapping(value = "/dljc/basketData")
public class BasketDataController extends HussarBaseController<BasketData, BasketDataService> {

    private static final Logger logger = LoggerFactory.getLogger(BasketDataController.class);

    @Autowired
    private BasketDataService basketDataService;

    /**
     * 吊篮监测实时数据分页查询
     *
     * @param basketDataSearchVO
     * @return 查询结果
     */
    @AuditLog(moduleName = "吊篮监测实时数据", eventDesc = "表格查询", eventGrade = AuditEventGrade.SERVICE_LOG_TYPE, evnetType = AuditEventType.QUERY)
    @PostMapping("findByPage")
    public ApiResponse<BasketDataPageVO> findByPage(@RequestBody BasketDataSearchVO basketDataSearchVO) {
        //todo 没有获取项目编号工具类
        return basketDataService.findByPage(basketDataSearchVO);
    }

}
